﻿@using WebUI.Areas.Admin.Models.Clazz
@model ClazzInfoForEditViewModel
@{
	Layout = "~/Areas/Admin/Views/Shared/_AdminContent.cshtml";
}
@section body {
	<script>
		function onComplete(data) {
			$("#js-message").fadeIn();
			var resJson = data.responseJSON;
			if (resJson.code <= 0) {
				$("#js-message").attr("class", "alert alert-danger").find(".message").html(resJson.message);
			} else {
				$("#js-message").attr("class", "alert alert-success").find(".message").html(resJson.message);
				$(".form-group input").val("");
				$(".form-group input:first").focus();
			}
			// 3s 后隐藏
			setTimeout(function () {
				$("#js-message").fadeOut("slow");
			}, 3000);
		}
	</script>
}

<!-- start 提示框 -->
@Html.Partial("_MessagePartial")
<!-- end 提示框 -->
<!-- general form elements -->
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">班级 - 创建</h3>
	</div>
	<!-- /.box-header -->
	<!-- form start -->
	@using (Ajax.BeginForm(new AjaxOptions
	{
		HttpMethod = "Post",
		OnComplete = "onComplete"
	}))
	{
		<div class="box-body">
			<div class="form-group">
				@Html.LabelFor(m => m.InputClazzCode)
				@Html.TextBoxFor(m => m.InputClazzCode, new { @class = "form-control" })
			</div>
		</div>
		<div class="box-footer">
			<div class="btn-group">
				@if (TempData["RedirectUrl"] != null)
				{
					<a class="btn btn-default" href="@TempData["RedirectUrl"].ToString()">返回</a>
				}
				else
				{
					<a class="btn btn-default" href="javascript:history.go(-1);">返回</a>
				}
				<input class="btn btn-primary" type="submit" value="添加" />
			</div>
		</div>
	}
</div>

